package me.idashu.attg.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import me.idashu.attg.domain.PersonInfoEntity;
import me.idashu.attg.persistence.PersonInfoMapper;

@Service
public class PersonInfoService {
	@Autowired
	private PersonInfoMapper personInfoMapper;

	public void insertPersonInfo(PersonInfoEntity personInfoEntity) {
		personInfoMapper.insertPersonInfo(personInfoEntity);
	}

	public void deletePersonInfo(long id) {
		personInfoMapper.deletePersonInfo(id);
	}

	public void deleteOwnPersonInfos(long toId) {
		personInfoMapper.deleteOwnPersonInfos(toId);
	}

	public void updateOwnPersonInfo(long toId) {
		personInfoMapper.updateOwnPersonInfo(toId);
	}

	public List<PersonInfoEntity> getPersoninfos(
			PersonInfoEntity personInfoEntity) {
		List<PersonInfoEntity> listPersonInfo = personInfoMapper
				.getPersoninfos(personInfoEntity);
		return listPersonInfo;
	}
}
